<?php
require_once 'libs/Smarty.class.php';
/*dev by ngannv*/
class Smarty_Ci extends Smarty{
	
	public function __construct(){
		$this->left_delimiter='{';
		$this->right_delimiter='}';//mặc định
        $this->compile_dir=(!empty($config['smarty_compile_dir']) ? $config['smarty_compile_dir']: APPPATH.'/cache/');
		$this->template_dir=(!empty($config['smarty_template_dir']) ? $config['smarty_template_dir'] : APPPATH.'/views/');
		$this->caching=false;
		/*  URL của CI */
		if(function_exists('site-url')){
			$this->assign('site-url',site_url());
		}

	}
    public function view($template,$data=null){
        if($data!=null){
            foreach($data as $key=>$value){
                $this->assign($key,$value);
            }
        }
        $this->display($template,$data);
    }
}